package com.android.cattlefarm;

import android.app.Activity;
import android.content.Intent;
import android.os.Environment;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.text.Html;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.android.cattlefarm.util.Constants;

import java.io.File;

/**
 * Created by Huang on 2015/7/4.
 */
public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        File file = new File("/mnt/sdcard/" + Constants.FILE_ROOT);
        if (!file.exists())
            file.mkdirs();
        TextView tip = (TextView) findViewById(R.id.tip);
        tip.setText(Html.fromHtml(getString(R.string.tip)));
    }


    /**
     * 导入
     *
     * @param v
     */
    public void importClick(View v) {
        startActivity(new Intent(this, ImportActivity.class));
    }

    /**
     * 导出
     *
     * @param v
     */
    public void exportClick(View v) {
        startActivity(new Intent(this, ExportActivity.class));
    }

    /**
     * 添加
     *
     * @param v
     */
    public void addClick(View v) {
//        if(App.getInstance().getImportEntityList() == null || App.getInstance().getImportEntityList().size() == 0) {
//            Toast.makeText(this, "请先导入牛场信息!",Toast.LENGTH_SHORT).show();
//            return ;
//        }
        startActivity(new Intent(this, AddActivity.class));
    }

    public void conlClick(View v){
        startActivity(new Intent(this, MergeActivity.class));
    }
}
